
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="css/index.css" />
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>	
	<script type="text/javascript">
		 function insert(){
		  //得到添加字段的名称
		  var aName=document.getElementById("aname");
		  var acontent=document.getElementById("acontent");
		  var form1=document.getElementById("form1");
		 	form1.submit();
		 	
		 }
		$(document).ready(function () {
			if(${errorMsg!=null}){
			    alert("${errorMsg}");
			}
			if(${successMsg!=null}){
			    alert("添加成功");
			    window.location.href="<%=basePath%>showAll";
			}
        });


	
	</script>
</head>

<body>
<form  action="addZiDuan" id="form1">
	<table border="1" rules="all" align="center" cellpadding="8"
		cellspacing="8" bordercolor="#000000">
		<tr>
			<!-- <th style="background-color:#666">序号</th> -->
			<th style="background-color:#666">字段名称</th>
		</tr>
		<tr>
			<td><input type="text" name="aname" id="aname" placeholder="如：address" /></td>
		</tr>
		<tr>
			<td colspan="9" align="center"><input type="button" value="添加" onclick="javaScript:insert()"/>
			 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="showAll" >返回</a>
			</td>
		</tr>
	</table>
</form>
	
</body>
</html>
